import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    //mode: 'history',
    routes: [
        {
            path: '/',
            redirect : 'home'
        },
        {
            path: '/home',
            component: resolve => require(['../components/common/Layout.vue'], resolve),
            children:[
                {
                    path: '/',
                    component: resolve => require(['../components/page/Home.vue'], resolve)
                },
                {
                    path: '/vuetable',
                    component: resolve => require(['../components/page/VueTable.vue'], resolve)     // vue-datasource组件
                },
                {
                    path: '/baseform',
                    component: resolve => require(['../components/page/BaseForm.vue'], resolve)
                },
                {
                    path: '/vueeditor',
                    component: resolve => require(['../components/page/VueEditor.vue'], resolve)    // Vue-Quill-Editor组件
                },
                {
                    path: '/markdown',
                    component: resolve => require(['../components/page/Markdown.vue'], resolve)     // Vue-Quill-Editor组件
                },
                {
                    path: '/upload',
                    component: resolve => require(['../components/page/Upload.vue'], resolve)       // Vue-Core-Image-Upload组件
                },
                {
                    path: '/basecharts',
                    component: resolve => require(['../components/page/BaseCharts.vue'], resolve)   // vue-schart组件
                },
                {
                    path: '/drag',
                    component: resolve => require(['../components/page/DragList.vue'], resolve)    // 拖拽列表组件
                }
            ]
        },
        {
            path: '/mydash',
            component: resolve => require(['../components/common/MyLayout.vue'], resolve),
            children : [
                {
                    path: '/',
                    component: resolve => require(['../components/page/MyDash.vue'], resolve)
                },
                {
                    path: '/quicktest-:id',
                    component: resolve => require(['../components/page/QuickTest.vue'], resolve)
                },
                {
                    path: '/quicktestreport-:id',
                    component: resolve => require(['../components/page/QuickTestReport.vue'], resolve)
                },
                {
                    path: '/zxtest-:id',
                    component: resolve => require(['../components/page/ZxTest.vue'], resolve)
                },
                {
                    path: '/zxtestreport-:id',
                    component: resolve => require(['../components/page/ZxTestReport.vue'], resolve)
                },
                {
                    path: '/realtest-:id',
                    component: resolve => require(['../components/page/RealTest.vue'], resolve)
                },
                {
                    path: '/lianxibaogao-:id',
                    component: resolve => require(['../components/page/Lianxibaogao.vue'], resolve)
                },
                {
                    path: '/realtestreport-:id',
                    component: resolve => require(['../components/page/RealTestReport.vue'], resolve)
                },
                {
                    path: '/comptest-:id',
                    component: resolve => require(['../components/page/CompTest.vue'], resolve)
                },
                {
                    path: '/comptestreport-:id',
                    component: resolve => require(['../components/page/CompTestReport.vue'], resolve)
                },
                {
                    path: '/myanalysis',
                    component: resolve => require(['../components/page/MyAnalysis.vue'], resolve)
                },
                {
                    path: '/mytest',
                    component: resolve => require(['../components/page/MyTest.vue'], resolve)
                },
                {
                    path: '/mytestreport',
                    component: resolve => require(['../components/page/MyTestReport.vue'], resolve)
                },
                {
                    path: '/mywronganalysis',
                    component: resolve => require(['../components/page/MyWrongAnalysis.vue'], resolve)
                },
                {
                    path: '/my',
                    component: resolve => require(['../components/page/My.vue'], resolve)
                },
                {
                    path: '/lianxibaogao',
                    component: resolve => require(['../components/page/Lianxibaogao.vue'], resolve)
                }
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
        {
            path: '/register',
            component: resolve => require(['../components/page/Register.vue'], resolve)
        }
    ]
})
